package com.xmcc.controller;


import com.xmcc.common.PageCommon;
import com.xmcc.common.ResultJson;
import com.xmcc.dto.SysLogDto;
import com.xmcc.pojo.SysLog;
import com.xmcc.pojo.SysLogWithBLOBs;
import com.xmcc.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("sys/log")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;
    @RequestMapping("log.page")
    public String logPage(){
        return "log";
    }

    @RequestMapping("page.json")
    @ResponseBody
    public ResultJson pageList(Integer pageSize, Integer pageNo, SysLogDto sysLogDto){

        PageCommon<SysLogWithBLOBs> pageCommon = sysLogService.queryList(pageSize,pageNo,sysLogDto);
        return ResultJson.success(pageCommon);
    }

    @RequestMapping("recover.json")
    public ResultJson recover(Integer id){
        sysLogService.recover(id);
        return ResultJson.success();
    }
}
